<template>
	<view>
		<rich-text :nodes="content"></rich-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type:'',
				content:'',
			}
		},
		onLoad(options) {
			if(options.type==4){
				uni.setTopBarText('用户协议')
			}
			if(options.type==5){
				uni.setTopBarText('隐私协议')
			}
			this.type = options.type
			this.getData()
		},
		methods: {
			getData(){
				let self = this;
				uni.showLoading({
					title: '加载中...'
				});
				self._get('news.pages/index/id/'+self.type, {
					id:self.type
				}, res => {
					self.content = res.data.content;
					uni.hideLoading();
				});
			},
		}
	}
</script>

<style>

</style>
